//
//  MyLabel.m
//  evidenceGather
//
//  Created by 王继伟 on 13-8-30.
//  Copyright (c) 2013年 无. All rights reserved.
//

#import "MyLabel.h"
 
#define FONTSIZE 13
#define COLOR(R,G,B,A) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:A]

@implementation MyLabel

@synthesize delegate;
@synthesize labelCode;
@synthesize labelName;
@synthesize labelUser;
@synthesize superCtrl;

// 设置换行模式,字体大小,背景色,文字颜色,开启与用户交互功能,设置label行数,0为不限制
- (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame])
    {
        [self setLineBreakMode:UILineBreakModeWordWrap|UILineBreakModeTailTruncation];
        [self setFont:[UIFont systemFontOfSize:FONTSIZE]];
        [self setBackgroundColor:[UIColor clearColor]];
        [self setTextColor:COLOR(59,136,195,1.0)];
        [self setUserInteractionEnabled:YES];
//        [self setNumberOfLines:0];
        [self setLineBreakMode:NSLineBreakByWordWrapping];
        
    }
    return self;
}

// 点击该label的时候, 来个高亮显示
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    
}

// 还原label颜色,获取手指离开屏幕时的坐标点, 在label范围内的话就可以触发自定义的操作
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    [self.delegate  clickLable:self]; 
}

 
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{  
}
 


- (void)dealloc {
    [super dealloc];
}
@end